1. Field of the Invention
This invention relates to mouse for computers, and more particularly, to a quadrature encoding device with an improved bistable trigger circuit (referred to as a slope-triggered digitizing circuit in this specification), which can be used in a mechanical mouse for producing two square-wave signals that can be combined to indicate the current mouse movement for position control of the mouse cursor on the computer screen.
2. Description of Related Art
Modem computers typically utilize a graphic-based operating environment, called graphical user interface (GUI), for the user to operate the computer conveniently and easily with a point device, such as a mouse or the like. The user can select and activate options simply by pointing and clicking with the mouse.
FIG. 1 is a schematic diagram used to depict the operation of a typical mechanical mouse. As shown, this type of mouse includes a ball 140, a shaft 125, a turning disk 120, and a light source 110 such as a light-emitting diode (LED), and a double-detector photo detection module 130 (note that the mouse actually includes a pair of shafts and a pair of turning disks for the translation of the ball motion into analog electrical signals, but since they are identical in structure and function, only one is illustrated). The double-detector photo detection module 130 includes a pair of photo transistors 131, 132 which are separated by a predetermined distance (see FIG. 2B). Further, as shown in FIG. 2A, the turning disk 120 is a circular disk having a plurality of slots 121 arranged at equal intervals on the rim thereof. When the user moves the mouse over a desk pad in a particular direction, it will cause the ball 140 to rotate in the corresponding direction. The rotation of the ball 140 is then transmitted via the shaft 125 to the turning disk 120, causing the turning disk 120 to rotate. As a result, the light from the light source 110 will intermittently pass through the slots 121 in the turning disk 120 onto the double-detector photo detection module 130. As shown in FIG. 2B, the double-detector photo detection module 130 includes a pair of photo detectors 131, 132, such as a pair of photo transistors. When the slots 121 in the turning disk 120 pass one after one over the photo transistors 131, 132, the light striking on the photo transistors 131, 132 will vary in intensity substantially in a sinusoidal manner. In response, the first photo transistor 131 will generate a first opto-electrical signal A, while the second photo transistor 132 will generate a second opto-electrical signal B, each with a sinusoidal waveform as illustrated in FIG. 2C.
Referring to FIG. 2B together with FIG. 2C, when the first photo transistor 131 is entirely exposed through any one of the slots 121 in the turning disk 120, the output opto-electrical signal A from the first photo transistor 131 will be at the maximum amplitude, as indicated by the point P1 in FIG. 2C. As the current slot 121 moves onwards, the first photo transistor 131 will gradually become partly exposed through the current slot 121 to light source 110, thus causing the output opto-electrical signal A to be gradually declining in amplitude. Until the first photo transistor 131 is entirely unexposed through any of the slots 121 in the turning disk 120 to the light source 110, the output opto-electrical signal A from the first photo transistor 131 will be at the minimum amplitude, as indicated by the point P2 in FIG. 2C. This results in a sinusoidal waveform for the output opto-electrical signal A from the first photo transistor 131. Similarly, the output opto-electrical signal B from the second photo transistor 132 is also a sinusoidal waveform. By specification, the first and second photo transistors 131, 132 are separated by a predetermined distance and the slots 121 in the turning disk 120 are arranged at a predetermined fixed interval that allow the output opto-electrical signals A, B to be out of phase by a predetermined degree, for example 90.degree. (hence, the encoding means is referred to as a quadrature encoding device).
FIG. 3 is a schematic diagram showing the detailed circuit structure of the conventional quadrature encoding device utilized in the mouse of FIG. 1 to translate the disk motion into digital signals that can be further processed and then used for position control of the mouse cursor on the computer screen. As shown, the first opto-electrical signal A from the first photo transistor 131 is taken from the potential drop across a first resistor 331 connected between the first photo transistor 131 and the ground; and in a similar manner, the second opto-electrical signal B from the second photo transistor 132 is taken from the potential drop across a second resistor 332 connected between the second photo transistor 132 and the ground. The amplitude of the first opto-electrical signal A is proportional to the intensity of the light incident on the first photo transistor 131; and likewise, the amplitude of the second opto-electrical signal B is proportional to the intensity of the light incident on the second photo transistor 132.
The first opto-electrical signal A from the first photo transistor 131 is subsequently converted by a first Schmitt circuit 311 (which a well-known bistable trigger circuit) into a first square-wave signal A', in such a manner that when the amplitude of the opto-electrical signal A is above a predefined threshold level V.sub.r, as shown in FIG. 4, the output signal A' is switched to a high-voltage logic state, representing a first logic value, for example 1; and when below the threshold level V.sub.r, the output signal A' is switched to a low-voltage logic state, representing a second logic value, for example 0.
In a similar manner, the second opto-electrical signal B from the second photo transistor 132 is subsequently converted by a second Schmitt circuit 312 into a second square-wave signal B', in such a manner that when the amplitude of the opto-electrical signal B is above a predefined threshold level V.sub.r, as shown in FIG. 4, the output signal B' is switched to a high-voltage logic state; and when below the threshold level V.sub.r, the output signal B' is switched to a low-voltage logic state.
By present mouse standard, the width of each of the slots 121 in the turning disk 120 and the distance between each neighboring pair of the slots 121 are both set to be exactly 3/4 of the separating distance between the first and second photo transistors 131, 132. This scheme allows the two opto-electrical signals A, B to be out of phase by 90.degree.. When the turning disk 120 is rotating at a fixed speed in a certain direction, the two opto-electrical signals A, B will have the same period, but have a phase difference of 90.degree., as illustrated in FIG. 4. As a result, each time when the first opto-electrical signal A reaches the maximum amplitude (the point P1), the second opto-electrical signal B will reaches the maximum amplitude after a duration of 1/4 of the period thereof. Assume the threshold level V.sub.r is set at the mid-point between the maximum and minimum amplitude points the opto-electrical signal, then the second square-wave signal B' will lag the first square-wave signal A' by a duration of half of the width of each pulse thereof, as illustrated in FIG. 4. These two square-wave signals A', B' are then transferred to a micro-controller unit (MCU) 320, which accordingly determines the current direction and displacement of the mouse being moved by the user for position control of the mouse cursor on the computer screen.
FIGS. 5A-5B are schematic diagrams used to depict the logic values of (A', B') in relation to the rotational direction of the turning disk 120; wherein FIG. 5A shows the case of the turning disk 120 being rotating in the clockwise direction, while FIG. 5B shows the case of the turning disk 120 being rotating in the counterclockwise direction.
Assume each high-voltage state in the square-wave signals (A', B') represents a logic value of 1, and each low-voltage state represents a logic value of 0. Then, as shown in FIG. 5A, when (A', B') varies cyclically in the sequence (00).fwdarw.(10).fwdarw.(11) .fwdarw.(01).fwdarw.(00), it indicates that the turning disk 120 is currently being rotated in the clockwise direction. Whereas, as shown in FIG. 5B, when (A', B') varies cyclically in the sequence (00).fwdarw.(01).fwdarw.(11).fwdarw.(10).fwdarw.(00), it indicates that the turning disk 120 is currently being rotated in the counterclockwise direction. Moreover, the speed of the mouse movement can be determined by checking the rate of change in the logic values of (A', B').
One drawback to the use of the Schmitt circuit in the foregoing quadrature encoding device of FIG. 3 is that the Schmitt circuit can be drifted in the threshold voltage due to aging or errors in manufacture, which can then undesirably affect the output characteristic of the quadrature encoding device. This drawback is illustratively depicted in FIG. 6. Assume V.sub.i is the waveform of the output opto-electrical signal from a photo transistor according to the specification of the photo transistor, and V.sub.r is the threshold voltage set to the Schmitt circuit. Typically, the threshold voltage V.sub.r is set at the midpoint between the maximum and minimum amplitudes of V.sub.i, which allows the duration of the high-voltage output in the square-wave signal from the Schmitt circuit to be substantially equal to the duration of the low-voltage output, as indicated by the waveform V.sub.o in FIG. 6. However, in practice, it is usually impossible to manufacture every photo transistor to possess the same output characteristic according to its specification. In the event that the output opto-electrical signal from a certain photo transistor has a maximum amplitude lower than the specification, as the waveform indicated by V.sub.i ' in FIG. 6, the duration of the high-voltage output in the square-wave signal from the Schmitt circuit would be shorter than the duration of the low-voltage output, as indicated by the waveform V.sub.o ' in FIG. 6. This deviation would result in errors in the logic values of the two square-wave signals from the quadrature encoding device, thus resulting in an erroneous control of the mouse cursor on the computer screen by the MCU. Moreover, the ambient light can affect the output characteristic of the photo transistors, which would also result in errors in the position control of the mouse cursor.
One conventional solution to the foregoing problem is to use analog-to-digital converting means or the equivalent that is capable of adaptively adjusting the threshold voltage based on the output characteristic of the photo transistor being used. This solution, however, requires a more complex hardware circuit to implement, thus considerably increasing the manufacturing cost.
In conclusion, the use of Schmitt circuit in the conventional quadrature encoding device for a mechanical mouse has the following disadvantages.
(1) First, the Schmitt circuit can be easily affected in its output characteristic by the ambient light, which would cause an erroneous control to the mouse cursor.
(2) Second, in the event that the photo transistor used in conjunction with the Schmitt circuit has a deviated output characteristic, the threshold voltage of the Schmitt circuit should be adapatively adjusted, which requires complex hardware circuit to implement, causing the manufacturing cost to be high.